<script>
    function saveJob(url){
        $.ajax({
            url:'index.php?r=salespersonportal/jobs/update&jobid='+jobid,
            timeOut:200,
            type:'post',
            data:$('#jobs-form').serialize(),
            success:function(){
                window.location=url;
            }
        });
        
        return false;
    }
    function showNotice(){
   
        Ext.MessageBox.show({
            title:'Status',
            msg:'This feature is not available',
            buttons:Ext.MessageBox.OK
        });
    }
</script>
<?php


$this->widget('zii.widgets.CMenu',array(
    'items'=>array(
        array(
            'label'=>'Notes',
            'url'=>'javascript:void(0)',
            'active'=>Yii::app()->controller->id=='jobsnotes',
            'linkOptions'=>array(
                'onclick'=>'saveJob("index.php?r=salespersonportal/jobsnotes/index&jobid='.$model->jobid.'")'
            )),
        array(
            'label'=>'Documents',
            'url'=>'javascript:void(0)',
            'active'=>Yii::app()->controller->id=='jobsdocuments',
            'linkOptions'=>array(
                'onclick'=>'saveJob("index.php?r=jobsdocuments/index&jobid='.$model->jobid.'")'
            )
        ),    
        array(
            'label'=>'Billing',
            'url'=>'javascript:void(0)',
            'active'=>Yii::app()->controller->id=='jobsbillingstatus',
            'linkOptions'=>array(
                'onclick'=>'showNotice()'
            )),
        array(
                'label'=>'PO\'s',
                'url'=>'javascript:void(0)',
                'linkOptions'=>array(
                    'onclick'=>'showNotice()'
                ),
            ),
            
        
        
        
    ),
    'id'=>'tab-menu',
    'htmlOptions'=>array(
        'class'=>'tabs tabs-with-summary',
    ),
));
?>
